package com.alibaba.citrus.ots.price.ability.functions.entity.activity;

import com.epoch.app.otspricecenter.model.dto.SegmentedActivityCombinationSDO;
import lombok.Data;

import java.util.List;

/**
 * @author: qiaojiange
 * @create: 2021/11/18
 * @Description 坎级组合表
 */
@Data
public class SegmentedActivityCombinationEntity {
    /**
     * 坎级活动列表
     */
    private SegmentedActivityCombinationSDO combinationSDO;

    /**
     * 坎级活动组合
     *
     * @param combinationSDO
     * @return
     */
    public static SegmentedActivityCombinationEntity of(SegmentedActivityCombinationSDO combinationSDO) {
        SegmentedActivityCombinationEntity combinationEntity = new SegmentedActivityCombinationEntity();
        combinationEntity.setCombinationSDO(combinationSDO);
        return combinationEntity;
    }

    /**
     * 获取公用组
     *
     * @return
     */
    public String obtainCommonGroup() {
        return this.combinationSDO.getCommonGroup();
    }


    /**
     * 获取原品 ID
     *
     * @return
     */
    public String obtainItemId() {
        return this.combinationSDO.getItemId();
    }

    /**
     * 获取原品数量
     *
     * @return
     */
    public Long obtainItemQuantity() {
        return (long) this.combinationSDO.getItemQuantity();
    }

    /**
     * 坎级活动单价
     *
     * @return
     */
    public String obtainSegmentedActivityUnitPrice() {
        return this.combinationSDO.getSegmentedActivityUnitPrice();
    }

    /**
     * 获取坎级活动 ID 和公用组的字符拼接，主要解决同一主单使用了坎级活动 ID 不同，但公用组是相同的组合特价问题
     *
     * @return 装饰
     */
    public String obtainChangeCommonGroup() {
        return this.combinationSDO.getSegmentedActivityId() + "_" + this.combinationSDO.getCommonGroup();
    }

    /**
     * 获取活动id
     * @return
     */
    public String obtainActivityId() {
        return this.combinationSDO.getActivityId();
    }

    /**
     * 获取活动 termId
     * @return
     */
    public String obtainTermId() {
        return this.combinationSDO.getActivityTermId();
    }
}
